import React from 'react';
import { connect } from 'dva';
import { TabBar, Icon,TextareaItem } from 'antd-mobile';
import { routerRedux } from 'dva/router';
import content from '../../../../common/contentCss/content.css';
import styles from './common.css';
import CustTitle from '../../../../common/title/title';
import { createForm } from 'rc-form';
import CommentPartTime from './pages/commentPartTime/commentPartTime';

function Index({loading, dispatch, commentPartTime}) {

  const { applicationId } = commentPartTime;

  const commentPartTimeProps = {
    onSubmit(data){
      data.applicationId = applicationId;
      dispatch({
        type:'commentPartTime/postCommentContent',
        payload:{
          ...data
        }
      })
    },
    goBack(){
      dispatch(routerRedux.goBack());
    }
  }

  return (

    <div style={{backgroundColor:'#fff'}}>
      <CommentPartTime {...commentPartTimeProps}/>
    </div>
  )
}

function mapStateToProps(state, ownProps) {
  return {
    loading: state.loading.global,
    commentPartTime: state.commentPartTime
  }
}
const IndexText = createForm()(Index);

export default connect(mapStateToProps)(IndexText);
